package cloud.maque.auth.handler.login;

import cloud.maque.auth.model.LoginRequest;
import cloud.maque.auth.model.LoginResponse;
import cloud.maque.auth.service.AuthService;
import org.springframework.stereotype.Service;

@Service
public class DefaultLoginHandler<T> extends AbstractLoginProcessorHolder<AuthService> implements LoginHandlerInterface {

    @Override
    public LoginResponse login(LoginRequest request) {
        AuthService processor = getProcessor(AuthService.class, request.getLoginType());
        return processor.login(request);
    }
}
